package com.howard.modules.person.dao.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.howard.modules.person.bean.Person;
import com.howard.modules.person.dao.PersonDao;
import com.howard.modules.base.dao.impl.AppBaseDaoImpl;

@Transactional
@Service
public class PersonDaoImpl extends AppBaseDaoImpl<Person> implements PersonDao {
	/*
	@Resource 
	private SessionFactory sessionFactory;

	public void save(Person person){
		sessionFactory.getCurrentSession().persist(person);
	}
	
	public void update(Person person){
		sessionFactory.getCurrentSession().merge(person);
	}
	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public Person getPerson(Integer personid){
		return (Person)sessionFactory.getCurrentSession().get(Person.class, personid);
	}

	public void delete(Integer personid){
		sessionFactory.getCurrentSession().delete(
				sessionFactory.getCurrentSession().load(Person.class, personid));
	}
	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	@SuppressWarnings("unchecked")
	public List<Person> getPersons(){		
		return sessionFactory.getCurrentSession().createQuery("from Person").list();
	}
	*/
	@Override
	public Class<Person> getDomainClass() {
		return Person.class;
	}

	
}
